//
//  HEMiniTools.m
//  HealthElderly
//
//  Created by 吴欧 on 2021/9/26.
//  Copyright © 2021 honglutec. All rights reserved.
//

#import "HEMiniTools.h"

@implementation HEMiniTools

+ (void)jumpToWximin:(NSString *)path username:(NSString *)username {
    if ([WXApi isWXAppInstalled]) { //先判断是否安装微信
        WXLaunchMiniProgramReq *launchMiniProgramReq = [WXLaunchMiniProgramReq object];
        launchMiniProgramReq.userName = username;  //拉起的小程序的username-原始ID
    launchMiniProgramReq.path = path; //拉起小程序页面的可带参路径，不填默认拉起小程序首页
        launchMiniProgramReq.miniProgramType = WXMiniProgramTypeRelease; //拉起小程序的类型
    [WXApi sendReq:launchMiniProgramReq completion:^(BOOL success) {
        if (!success) {
            [Dialog toastBottom:@"无法唤起小程序"];
        }
    }];
    }else{
        //提示用户没有安装微信，不能拉起小程序
    }
}

@end
